package com.mo.lib.adapter

import androidx.annotation.LayoutRes
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @ author：mo
 * @ data：2020/11/11:11:03
 * @ 功能：单布局rv适配器
 */
abstract class BaseRvAdapter<T>(@LayoutRes private val layoutResId: Int, data: MutableList<T>? = null)
    : BaseQuickAdapter<T, BaseViewHolder>(layoutResId, data) {

    override fun convert(holder: BaseViewHolder, t: T) {
        doWhat(holder, t,holder.layoutPosition)
    }

    protected abstract fun doWhat(holder: BaseViewHolder, bean: T, position: Int)
}